//
//  KYCycleModalViewController.m
//  kuaiyi
//
//  Created by 杨亮 on 16/3/12.
//  Copyright © 2016年 kuaiyi. All rights reserved.
//

#import "KYCycleModalViewController.h"
#import <SVProgressHUD.h>

@interface KYCycleModalViewController ()<UIWebViewDelegate>
@property (nonatomic, strong)UIWebView *webView;
@end

@implementation KYCycleModalViewController
-(void)loadView{
    self.webView = [[UIWebView alloc]init];
    self.view = self.webView;
    self.view.backgroundColor = [UIColor whiteColor];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    NSURL *url = [NSURL URLWithString:self.link];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:request];
    self.webView.delegate = self;
}
-(void)webViewDidStartLoad:(UIWebView *)webView{
    [SVProgressHUD show];
}
-(void)webViewDidFinishLoad:(UIWebView *)webView{
    [SVProgressHUD dismiss];
}
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
    [SVProgressHUD dismiss];
    [SVProgressHUD showWithStatus:error.description];
}

@end
